package com.littleu.yojoincn.common.enumeration;

import java.util.stream.Stream;

public enum ScopeLevel {
    USER(16, "游客"),
    CELEBRITY(32, "达人");

    private int value;

    ScopeLevel(int value, String text) {
        this.value = value;
    }

    public int value() {
        return this.value;
    }

    public static ScopeLevel toType(int value) {
        return Stream.of(ScopeLevel.values())
                .filter(c -> c.value == value)
                .findAny()
                .orElse(null);
    }
}
